<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Agile Modbus: /home/runner/work/agile_modbus/agile_modbus/inc/agile_modbus_rtu.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Agile Modbus
   &#160;<span id="projectnumber">1.1.4</span>
   </div>
   <div id="projectbrief">Lightweight modbus protocol stack.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('agile__modbus__rtu_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">agile_modbus_rtu.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="agile__modbus__rtu_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#ifndef __PKG_AGILE_MODBUS_RTU_H</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#define __PKG_AGILE_MODBUS_RTU_H</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160; </div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#if AGILE_MODBUS_USING_RTU</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160; </div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160; </div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="group___r_t_u___exported___constants.html#ga0acfe5200e87289af0e996e28a5014ef">   32</a></span>&#160;<span class="preprocessor">#define AGILE_MODBUS_RTU_HEADER_LENGTH     1</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="group___r_t_u___exported___constants.html#gace39790c52a0a34e637c9ecf35b2ddc1">   33</a></span>&#160;<span class="preprocessor">#define AGILE_MODBUS_RTU_PRESET_REQ_LENGTH 6</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="group___r_t_u___exported___constants.html#gac42d8c18189788ecbac043e2235944db">   34</a></span>&#160;<span class="preprocessor">#define AGILE_MODBUS_RTU_PRESET_RSP_LENGTH 2</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="group___r_t_u___exported___constants.html#gaf5e4f433bd581c089fa6d00c1f8b4e50">   36</a></span>&#160;<span class="preprocessor">#define AGILE_MODBUS_RTU_CHECKSUM_LENGTH 2</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160; </div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="group___r_t_u___exported___constants.html#ga78548481d5cdf9c62b7b7a619be62507">   45</a></span>&#160;<span class="preprocessor">#define AGILE_MODBUS_RTU_MAX_ADU_LENGTH 256</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="structagile__modbus__rtu.html">   57</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structagile__modbus__rtu.html">agile_modbus_rtu</a> {</div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="structagile__modbus__rtu.html#a0cedf071c64b853a46524100bbf4229d">   58</a></span>&#160;    <a class="code" href="structagile__modbus.html">agile_modbus_t</a> <a class="code" href="structagile__modbus__rtu.html#a0cedf071c64b853a46524100bbf4229d">_ctx</a>; </div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="group___r_t_u___exported___types.html#ga784ce38d941cd22dba8bfcd6bc4db435">   59</a></span>&#160;} <a class="code" href="group___r_t_u___exported___types.html#ga784ce38d941cd22dba8bfcd6bc4db435">agile_modbus_rtu_t</a>;</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___r_t_u___exported___functions.html#ga96821440a21db41bb7b662ea8ff346ec">agile_modbus_rtu_init</a>(<a class="code" href="structagile__modbus__rtu.html">agile_modbus_rtu_t</a> *ctx, uint8_t *send_buf, <span class="keywordtype">int</span> send_bufsz, uint8_t *read_buf, <span class="keywordtype">int</span> read_bufsz);</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;}</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160; </div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* AGILE_MODBUS_USING_RTU */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160; </div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* __PKG_AGILE_MODBUS_RTU_H */</span><span class="preprocessor"></span></div>
<div class="ttc" id="agroup___r_t_u___exported___functions_html_ga96821440a21db41bb7b662ea8ff346ec"><div class="ttname"><a href="group___r_t_u___exported___functions.html#ga96821440a21db41bb7b662ea8ff346ec">agile_modbus_rtu_init</a></div><div class="ttdeci">int agile_modbus_rtu_init(agile_modbus_rtu_t *ctx, uint8_t *send_buf, int send_bufsz, uint8_t *read_buf, int read_bufsz)</div><div class="ttdoc">RTU initialization.</div><div class="ttdef"><b>Definition:</b> <a href="agile__modbus__rtu_8c_source.html#l00282">agile_modbus_rtu.c:282</a></div></div>
<div class="ttc" id="agroup___r_t_u___exported___types_html_ga784ce38d941cd22dba8bfcd6bc4db435"><div class="ttname"><a href="group___r_t_u___exported___types.html#ga784ce38d941cd22dba8bfcd6bc4db435">agile_modbus_rtu_t</a></div><div class="ttdeci">struct agile_modbus_rtu agile_modbus_rtu_t</div><div class="ttdoc">RTU structure.</div></div>
<div class="ttc" id="astructagile__modbus__rtu_html"><div class="ttname"><a href="structagile__modbus__rtu.html">agile_modbus_rtu</a></div><div class="ttdoc">RTU structure.</div><div class="ttdef"><b>Definition:</b> <a href="agile__modbus__rtu_8h_source.html#l00057">agile_modbus_rtu.h:57</a></div></div>
<div class="ttc" id="astructagile__modbus__rtu_html_a0cedf071c64b853a46524100bbf4229d"><div class="ttname"><a href="structagile__modbus__rtu.html#a0cedf071c64b853a46524100bbf4229d">agile_modbus_rtu::_ctx</a></div><div class="ttdeci">agile_modbus_t _ctx</div><div class="ttdoc">modbus handle</div><div class="ttdef"><b>Definition:</b> <a href="agile__modbus__rtu_8h_source.html#l00058">agile_modbus_rtu.h:58</a></div></div>
<div class="ttc" id="astructagile__modbus_html"><div class="ttname"><a href="structagile__modbus.html">agile_modbus</a></div><div class="ttdoc">Agile Modbus structure.</div><div class="ttdef"><b>Definition:</b> <a href="agile__modbus_8h_source.html#l00217">agile_modbus.h:217</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_bfccd401955b95cf8c75461437045ac0.html">inc</a></li><li class="navelem"><a class="el" href="agile__modbus__rtu_8h.html">agile_modbus_rtu.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
